﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for AreaTest and is intended
    ///to contain all AreaTest Unit Tests
    ///</summary>
    [TestClass()]
    public class AreaTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Area Constructor
        ///</summary>
        [TestMethod()]
        public void AreaConstructorTest() {
            Area target = new Area("alt");
            Assert.AreEqual("<area alt=\"alt\"/>", target.ToString());
        }

        /// <summary>
        ///A test for Alt
        ///</summary>
        [TestMethod()]
        public void AltTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.Alt = expected;
            actual = target.Alt;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Coords
        ///</summary>
        [TestMethod()]
        public void CoordsTest() {
            Area target = new Area("alt");
            target.Coords.Add(1);
            target.Coords.Add(2);
            Assert.IsTrue(target.Coords.Count == 2);
            Assert.IsTrue(target.Coords.Contains(1));
            Assert.IsTrue(target.Coords.Contains(2));
        }

        /// <summary>
        ///A test for Href
        ///</summary>
        [TestMethod()]
        public void HrefTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.Href = expected;
            actual = target.Href;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for HrefLang
        ///</summary>
        [TestMethod()]
        public void HrefLangTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.HrefLang = expected;
            actual = target.HrefLang;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Media
        ///</summary>
        [TestMethod()]
        public void MediaTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.Media = expected;
            actual = target.Media;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for NoHref
        ///</summary>
        [TestMethod()]
        public void NoHrefTest() {
            Area target = new Area("alt");
            bool expected = false;
            bool actual;
            target.NoHref = expected;
            actual = target.NoHref;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Rel
        ///</summary>
        [TestMethod()]
        public void RelTest() {
            Area target = new Area("alt");
            target.Rel.Add("rel1");
            target.Rel.Add("rel2");
            Assert.IsTrue(target.Rel.Count == 2);
            Assert.IsTrue(target.Rel.Contains("rel1"));
            Assert.IsTrue(target.Rel.Contains("rel2"));
        }

        /// <summary>
        ///A test for Shape
        ///</summary>
        [TestMethod()]
        public void ShapeTest() {
            Area target = new Area("alt");
            Nullable<ShapeChoices> expected = ShapeChoices.Circle;
            Nullable<ShapeChoices> actual;
            target.Shape = expected;
            actual = target.Shape;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Target
        ///</summary>
        [TestMethod()]
        public void TargetTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.Target = expected;
            actual = target.Target;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Type
        ///</summary>
        [TestMethod()]
        public void TypeTest() {
            Area target = new Area("alt");
            string expected = string.Empty;
            string actual;
            target.Type = expected;
            actual = target.Type;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Area target = new Area("alt");
            target.Alt = "alt";
            target.Coords.Add(1);
            target.Coords.Add(2);
            target.Href = "href";
            target.HrefLang = "hreflang";
            target.Media = "media";
            target.Name = "name";
            target.NoHref = true;
            target.Rel.Add("rel1");
            target.Rel.Add("rel2");
            target.Shape = ShapeChoices.Circle;
            target.Target = "target";
            target.Type = "type";
            Assert.AreEqual("<area alt=\"alt\" " +
                "coords=\"1,2,\" " +
                "href=\"href\" " +
                "hreflang=\"hreflang\" " +
                "media=\"media\" " +
                "name=\"name\" " +
                "nohref=\"nohref\" " +
                "rel=\"rel1 rel2 \" " +
                "shape=\"circle\" " +
                "target=\"target\" " +
                "type=\"type\"/>", target.ToString());
        }
    }
}
